package middleware

import (
	"gitee.com/chejiangyi/bsfgo/core/base2"
	"gitee.com/chejiangyi/bsfgo/core/utils"
	"gitee.com/chejiangyi/bsfgo/gin2/session2"
	"github.com/gin-gonic/gin"
)

type SessionMiddleware struct{}

func (*SessionMiddleware) GetOrder() float64 {
	return -92
}
func (m *SessionMiddleware) Enabled() bool {
	return base2.BsfConfigInstance.GetSessionEnabled()
}
func (*SessionMiddleware) Middleware(r *gin.Engine) {
	session2.SessionUtil.InitSession(r)
	utils.LogUtil.Info("SessionMiddleware已开启,支持Session(%v模式)", base2.BsfConfigInstance.GetSessionMode())
}
